/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.mallsite.modules.shop.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品规格选项Entity
 * @author ruyang
 * @version 2020-12-04
 */
@Table(name="ms_goods_spec_item", alias="a", columns={
		@Column(name="spec_item_id", attrName="specItemId", label="类型编码", isPK=true),
		@Column(name="spec_id", attrName="specId", label="规格id"),
		@Column(name="item_value", attrName="itemValue", label="规格值"),
		@Column(name="item_sort", attrName="itemSort", label="规格排序"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class GoodsSpecItem extends DataEntity<GoodsSpecItem> {
	
	private static final long serialVersionUID = 1L;
	private String specItemId;		// 类型编码
	private String specId;		// 规格id
	private String itemValue;		// 规格值
	private Integer itemSort;		// 规格排序
	
	public GoodsSpecItem() {
		this(null);
	}

	public GoodsSpecItem(String id){
		super(id);
	}
	
	public String getSpecItemId() {
		return specItemId;
	}

	public void setSpecItemId(String specItemId) {
		this.specItemId = specItemId;
	}
	
	@NotBlank(message="规格id不能为空")
	@Length(min=0, max=60, message="规格id长度不能超过 60 个字符")
	public String getSpecId() {
		return specId;
	}

	public void setSpecId(String specId) {
		this.specId = specId;
	}
	
	@Length(min=0, max=512, message="规格值长度不能超过 512 个字符")
	public String getItemValue() {
		return itemValue;
	}

	public void setItemValue(String itemValue) {
		this.itemValue = itemValue;
	}
	
	@NotNull(message="规格排序不能为空")
	public Integer getItemSort() {
		return itemSort;
	}

	public void setItemSort(Integer itemSort) {
		this.itemSort = itemSort;
	}
	
}